package com.example.music.strategy

object CalculateHandler {

    private val calculateMap by lazy {
        mutableMapOf(
            "+" to SumCalculate(),
            "-" to SubtractionCalculate(),
            "*" to MultiplicationCalculate()
        )
    }

    /**
     * 计算
     */
    fun doCalculate(type: String, number1: Int, number2: Int): Int? {
        return calculateMap[type]?.doCalculate(number1, number2)
    }
}